home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d17 / swplpt_a.arc / SWAPLPTS.ASM < prev    next >
Assembly Source File  |  1991-04-12  |  1KB  |  48 lines

  1.                 page    60,132
  2.                 title    SWAPLPTS - Swap LPT1 and LPT2
  3. ; S W A P L P T S . A S M
  4. ;
  5. ; Copyright(C) 1991 John W Grothman.  All rights reserved.
  6. ;
  7. ; Released to the public domain.
  8. ;
  9. ; purpose:
  10. ;    Swap LPT1 and LPT2.
  11. ;
  12. ; to do:
  13. ;
  14. ; technical notes:
  15. ;    This is a SIMPLE thing to do.  Just swap the base I/O addresses
  16. ;    in low DOS memory that DOS uses to map the LPT port hardware.
  17. ;
  18. ; modification log:
  19. ; 1.0        4/12/90     John W Grothman (CompuServe 73740,1540)
  20.  
  21. cseg    segment para public 'code'
  22.         assume    cs:cseg, ds:cseg, es:cseg, ss:cseg
  23.  
  24.         org     100h
  25.  
  26. begin    proc near
  27.         xor        ax, ax
  28.         mov        ds, ax        ; set DS to 0 (DOS low memory (data) area)
  29.         mov        bx, 0408h    ; low DOS memory offset of LPT1 base I/O address
  30.         mov        ax, [bx]    ; get it and
  31.         mov        dx, ax        ;    save in DX
  32.         mov        bx, 040ah    ; low DOS memory offset of LPT2 base I/O address
  33.         mov        ax, [bx]    ; get it and
  34.         mov        cx, ax        ;    save in CX
  35.         mov        ax, dx        ; get back LPT1
  36.         mov        [bx], ax    ; and put it in LPT2
  37.         mov        bx, 0408h    ; address of LPT1 base I/O address
  38.         mov        ax, cx        ; get back LPT2
  39.         mov        [bx], ax    ; and put it in LPT1
  40.  
  41.         mov     ax, 4c00h    ; terminate with ERRORLEVEL = 0
  42.         int     21h
  43.         ret
  44. begin    endp
  45. cseg    ends
  46.         end     begin
  47.